<?php
namespace Mobile\Controller;

use Plugins\shanyou\submit;
class ShanyouController extends MobileBaseController {

    private  $userId;
    private  $submit;
    private  $pageSize;
    private  $pageNum;
    public  function  __construct()
    {
        $userId = I("get.uid");
        $this->userId=!empty($userId)?$userId:"0";
        $pageSize=I("get.pageSize");
        $pageNum=I("get.pageNum");
        $this->pageSize = !empty($pageSize)?$pageSize:"10";
        $this->pageNum = !empty($pageNum)?$pageNum:"1";
        

    }
    
    public function getSign(){
       include_once  "plugins/shanyou/submit.php";
       $this->submit = new submit(); 
       $sign = $this->submit->getSign($this->userId);
       exit(json_encode($sign));
    }
    
    
    

    public  function  getList(){
        include_once  "plugins/shanyou/submit.php";
        $this->submit = new submit();
        $orderType =I("orderType");
        $orderType = !empty($orderType)?$orderType:"1";
        $list = $this->submit->getList($this->userId,$this->pageSize,$this->pageNum,$orderType);
        exit(json_encode($list));

    }
    
    // 个人信息
    public function getUserInfo(){
        include_once  "plugins/shanyou/submit.php";
        $this->submit = new submit();
        $info = $this->submit->getInfo($this->userId);
        exit(json_encode($info));
    }
    
    public  function  getMyList(){
        include_once  "plugins/shanyou/submit.php";
        $this->submit = new submit();
        $showStatus =I("showStatus");
        $showStatus = !empty($showStatus)?$showStatus:"0";
        $list = $this->submit->getMyList($this->userId,$this->pageSize,$this->pageNum,$showStatus);
        exit(json_encode($list));
    }

    public  function  getTaskSearchList(){
        include_once  "plugins/shanyou/submit.php";
        $this->submit = new submit();
        $keyword =I("keyword");
        $keyword = !empty($keyword)?$keyword:"";
        $list = $this->submit->getTaskSearchList($this->userId,$this->pageSize,$this->pageNum,$keyword);
        exit(json_encode($list));
    }

    public  function  getOneHourAuthTaskList(){
        include_once  "plugins/shanyou/submit.php";
        $this->submit = new submit();
        $list = $this->submit->getOneHourAuthTaskList($this->userId,$this->pageSize,$this->pageNum);
        exit(json_encode($list));
    }
    
    
    
    
    
    public function getH5IndexPath(){
        
        if(empty($this->userId)){
            exit(json_encode(array("code"=>0,"msg"=>"请登录"),JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
        }
        $path ="" ;
        include_once  "plugins/shanyou/submit.php";
        $this->submit = new submit();
        $path = $this->submit->getH5IndexPath($this->userId);
        
        exit(json_encode(array("path"=>$path,"code"=>1),JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
    }
    
    //我的接单
    public function getH5minePath(){
        

        if(empty($this->userId)){
            exit(json_encode(array("code"=>0,"msg"=>"请登录"),JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
        }
        $path ="" ;
        include_once  "plugins/shanyou/submit.php";
        $this->submit = new submit();
        $path = $this->submit->getH5minePath($this->userId);
        exit(json_encode(array("path"=>$path,"code"=>1),JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
    }
    
    
    
    
    
    
    
    
    
    
}
?>